package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.applet.dto.PayOrderDto;
import com.shensi.api.admin.domian.market.dto.OilDto;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface OilClient {

    /**
     * 查询油站信息列表
     */
    @GetMapping("/oil/info/list")
    public TableDataInfo list(@SpringQueryMap OilDto oil);


    @GetMapping("/oil/info/listByLogin")
    public TableDataInfo listByStationId();


    @GetMapping("/oil/info/listByStationId")
    public TableDataInfo listoidByStationId(Long stationId);

    /**
     * 新增油品
     */
    @PostMapping("/oil/info")
    public AjaxResult add(@RequestBody OilDto oil);

    /**
     * 逻辑删除油品信息
     */
    @PostMapping(value = "/oil/info/delteOil")
    public AjaxResult deleteOil(@RequestBody OilDto oil);

    /**
     * 获取油站信息详细信息
     */
    @GetMapping(value = "/oil/info/{oilId}")
    public AjaxResult getInfo(@PathVariable("oilId") Long oilId);

    /**
     * 修改油站信息
     */
    @PutMapping("/oil/info")
    public AjaxResult edit(@RequestBody OilDto oil);

    @GetMapping("/oil/info/getListByEnterprise")
    public AjaxResult getListByEnterprise();


    @GetMapping("/oil/info/getListByEnterpriseOrStationId")
    public AjaxResult getListByEnterpriseOrStationId(@ApiParam(value = "油站id") @RequestParam(value = "stationId", required = false) Long stationId);
}
